package com.java.shop.ware.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.java.common.to.mq.StockLockedTo;
import com.java.shop.ware.entity.WareSkuEntity;
import com.java.shop.ware.vo.ProductToWareVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author cxq
 * @email 137512476@qq.com
 * @date 2021-04-22 18:22:16
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {
	void addStock(@Param("addStock") ProductToWareVo vo);

    Integer getStockBySkuId(@Param("skuId") Long skuId);

    List<Long> getWareBySKuId(@Param("skuId") Long skuId,@Param("num") Integer num);

    Long lockSkuStock(@Param("skuId")Long skuId,@Param("wareId") Long wareId,@Param("num") Integer num);

    Integer unLockStock(@Param("to") StockLockedTo to);
}
